An operating system performs various tasks relating to a computer system, including managing its hardware and software resources. Hardware resources include processors, primary storage (e.g., memory), secondary storage (e.g., hard disk or optical disk), printers, display adapters, network interface cards, input/output ports, etc. Software resources include application programs, user interfaces, device drivers, network protocol stacks, etc. The operating system manages and coordinates these resources to complete various tasks, such as under the direction of an application program.
Operating systems may complete their tasks in user mode or in kernel mode. When in user mode, components of the operating system generally perform tasks relating to application programs. When in kernel mode, components of the operating system generally perform tasks relating to managing hardware devices, device drivers, the operating system itself, and other tasks not directly relating to application programs.
When an application program or other component operating in user mode performs an action that invokes a component operating in kernel mode, a “context switch” occurs. Similarly, when a processor suspends execution of a process and begins execution of another process, a context switch occurs, which may be termed an inter-process. In various operating systems, processes are containers for one or more threads, and so an inter-process context switch may involve an inter-thread context switch. A context switch involves storing and restoring processor state, and is generally computationally intensive. Thus, context switches can degrade performance of an operating system and application programs.
Operating systems may provide functionality to application programs utilizing subsystems that operate in user mode. A subsystem is an operating system component that implements an operating system's application program interfaces (APIs). User mode subsystems are processes that may invoke functions of a kernel component operating in kernel mode. A kernel component is an operating system component that operates in kernel mode and provides core operating system functions. Thus, when an application calls a method of an operating system API, a subsystem implementing the method may invoke a function of a kernel component that operates in kernel mode. As a result, several context switches could occur. As examples, an inter-process context switch occurs when the application invokes a method of the operating system API, and one or more context switches to kernel mode could occur as the method of the operating system API invokes methods of the kernel. These context switches could cause poor operating system performance. Furthermore, when a user mode component invokes a function of a kernel mode component, the user mode component may send an inter-process communication. Inter-process communications may involve processing overhead that further degrades operating system performance. It would thus be highly desirable to improve operating system performance by reducing context switches and inter-process communications.